package org.example.test.mapper;

import org.apache.ibatis.annotations.*;
import org.example.test.entity.Position;

import java.util.List;

@Mapper
public interface PositionMapper {
@Select("SELECT * FROM  test.position where position_name like '%${positionName}%'")
    List<Position> findAll(String positionName);
@Delete("delete  from test.position where position_id = #{positionId} ")
    int delete(Integer positionId);
@Update("update test.position set position_id = #{positionId},position_name = #{positionName},position_des = #{positionDes},position_level = #{positionLevel} where position_id=#{positionId}")
    int update(Position position);
@Insert("INSERT into test.position(position_id,position_name,position_des,position_level)values " +
        "(#{positionId},#{positionName},#{positionDes},#{positionLevel})")
    int add(Position position);
}
